.class public Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;
.super Landroid/text/style/URLSpan;


# instance fields
.field a:Landroid/content/Context;

.field b:Ljava/lang/String;

.field c:Ljava/lang/String;

.field d:Landroid/view/View;


# direct methods
.method public constructor <init>(Ljava/lang/String;Landroid/content/Context;Ljava/lang/String;Landroid/view/View;)V
    .locals 0

    invoke-direct {p0, p1}, Landroid/text/style/URLSpan;-><init>(Ljava/lang/String;)V

    iput-object p2, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->a:Landroid/content/Context;

    iput-object p3, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->b:Ljava/lang/String;

    iput-object p4, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->d:Landroid/view/View;

    return-void
.end method

.method private a()V
    .locals 6

    const/4 v5, 0x1

    const/4 v4, 0x0

    const/4 v3, -0x1

    new-instance v0, Lcom/waiqin365/lightapp/im/widget/c;

    iget-object v1, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->a:Landroid/content/Context;

    invoke-direct {v0, v1}, Lcom/waiqin365/lightapp/im/widget/c;-><init>(Landroid/content/Context;)V

    new-instance v1, Landroid/widget/PopupWindow;

    invoke-virtual {v0}, Lcom/waiqin365/lightapp/im/widget/c;->a()Landroid/view/View;

    move-result-object v2

    invoke-direct {v1, v2, v3, v3}, Landroid/widget/PopupWindow;-><init>(Landroid/view/View;II)V

    invoke-virtual {v1, v5}, Landroid/widget/PopupWindow;->setFocusable(Z)V

    invoke-virtual {v1, v5}, Landroid/widget/PopupWindow;->setOutsideTouchable(Z)V

    new-instance v2, Landroid/graphics/drawable/BitmapDrawable;

    invoke-direct {v2}, Landroid/graphics/drawable/BitmapDrawable;-><init>()V

    invoke-virtual {v1, v2}, Landroid/widget/PopupWindow;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    new-instance v2, Lcom/waiqin365/lightapp/im/utils/m;

    invoke-direct {v2, p0, v1}, Lcom/waiqin365/lightapp/im/utils/m;-><init>(Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;Landroid/widget/PopupWindow;)V

    invoke-virtual {v0, v2}, Lcom/waiqin365/lightapp/im/widget/c;->a(Landroid/view/View$OnClickListener;)V

    new-instance v2, Lcom/waiqin365/lightapp/im/utils/n;

    invoke-direct {v2, p0, v1}, Lcom/waiqin365/lightapp/im/utils/n;-><init>(Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;Landroid/widget/PopupWindow;)V

    invoke-virtual {v0, v2}, Lcom/waiqin365/lightapp/im/widget/c;->b(Landroid/view/View$OnClickListener;)V

    iget-object v2, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->a:Landroid/content/Context;

    const v3, 0x7f0803af

    invoke-virtual {v2, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    const v3, 0x10003

    invoke-virtual {v0, v2, v3}, Lcom/waiqin365/lightapp/im/widget/c;->a(Ljava/lang/String;I)V

    iget-object v2, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->a:Landroid/content/Context;

    const v3, 0x7f080058

    invoke-virtual {v2, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    const v3, 0x10001

    invoke-virtual {v0, v2, v3}, Lcom/waiqin365/lightapp/im/widget/c;->a(Ljava/lang/String;I)V

    iget-object v2, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->a:Landroid/content/Context;

    const v3, 0x7f08025d

    invoke-virtual {v2, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    const v3, 0x10002

    invoke-virtual {v0, v2, v3}, Lcom/waiqin365/lightapp/im/widget/c;->a(Ljava/lang/String;I)V

    invoke-virtual {v0}, Lcom/waiqin365/lightapp/im/widget/c;->f()V

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->d:Landroid/view/View;

    const/16 v2, 0x11

    invoke-virtual {v1, v0, v2, v4, v4}, Landroid/widget/PopupWindow;->showAtLocation(Landroid/view/View;III)V

    return-void
.end method

.method static synthetic a(Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;)V
    .locals 0

    invoke-direct {p0}, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->b()V

    return-void
.end method

.method static synthetic a(Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;Ljava/lang/String;)V
    .locals 0

    invoke-direct {p0, p1}, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->a(Ljava/lang/String;)V

    return-void
.end method

.method private a(Ljava/lang/String;)V
    .locals 3

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v1, "tel:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    new-instance v1, Landroid/content/Intent;

    const-string/jumbo v2, "android.intent.action.CALL"

    invoke-direct {v1, v2, v0}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->a:Landroid/content/Context;

    invoke-virtual {v0, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->a:Landroid/content/Context;

    check-cast v0, Landroid/app/Activity;

    const v1, 0x7f040022

    const v2, 0x7f040021

    invoke-virtual {v0, v1, v2}, Landroid/app/Activity;->overridePendingTransition(II)V

    return-void
.end method

.method private b()V
    .locals 6

    const/4 v5, 0x1

    const/4 v4, 0x0

    const/4 v3, -0x1

    new-instance v0, Lcom/waiqin365/lightapp/im/widget/c;

    iget-object v1, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->a:Landroid/content/Context;

    invoke-direct {v0, v1}, Lcom/waiqin365/lightapp/im/widget/c;-><init>(Landroid/content/Context;)V

    new-instance v1, Landroid/widget/PopupWindow;

    invoke-virtual {v0}, Lcom/waiqin365/lightapp/im/widget/c;->a()Landroid/view/View;

    move-result-object v2

    invoke-direct {v1, v2, v3, v3}, Landroid/widget/PopupWindow;-><init>(Landroid/view/View;II)V

    invoke-virtual {v1, v5}, Landroid/widget/PopupWindow;->setFocusable(Z)V

    invoke-virtual {v1, v5}, Landroid/widget/PopupWindow;->setOutsideTouchable(Z)V

    new-instance v2, Landroid/graphics/drawable/BitmapDrawable;

    invoke-direct {v2}, Landroid/graphics/drawable/BitmapDrawable;-><init>()V

    invoke-virtual {v1, v2}, Landroid/widget/PopupWindow;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    new-instance v2, Lcom/waiqin365/lightapp/im/utils/o;

    invoke-direct {v2, p0, v1}, Lcom/waiqin365/lightapp/im/utils/o;-><init>(Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;Landroid/widget/PopupWindow;)V

    invoke-virtual {v0, v2}, Lcom/waiqin365/lightapp/im/widget/c;->a(Landroid/view/View$OnClickListener;)V

    new-instance v2, Lcom/waiqin365/lightapp/im/utils/p;

    invoke-direct {v2, p0, v1}, Lcom/waiqin365/lightapp/im/utils/p;-><init>(Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;Landroid/widget/PopupWindow;)V

    invoke-virtual {v0, v2}, Lcom/waiqin365/lightapp/im/widget/c;->b(Landroid/view/View$OnClickListener;)V

    iget-object v2, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->a:Landroid/content/Context;

    const v3, 0x7f0803af

    invoke-virtual {v2, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    const v3, 0x10003

    invoke-virtual {v0, v2, v3}, Lcom/waiqin365/lightapp/im/widget/c;->a(Ljava/lang/String;I)V

    iget-object v2, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->a:Landroid/content/Context;

    const v3, 0x7f08025f

    invoke-virtual {v2, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    const v3, 0x10001

    invoke-virtual {v0, v2, v3}, Lcom/waiqin365/lightapp/im/widget/c;->a(Ljava/lang/String;I)V

    iget-object v2, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->a:Landroid/content/Context;

    const v3, 0x7f08025c

    invoke-virtual {v2, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    const v3, 0x10002

    invoke-virtual {v0, v2, v3}, Lcom/waiqin365/lightapp/im/widget/c;->a(Ljava/lang/String;I)V

    invoke-virtual {v0}, Lcom/waiqin365/lightapp/im/widget/c;->f()V

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->d:Landroid/view/View;

    const/16 v2, 0x11

    invoke-virtual {v1, v0, v2, v4, v4}, Landroid/widget/PopupWindow;->showAtLocation(Landroid/view/View;III)V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 3

    invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;

    invoke-virtual {p0}, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->getURL()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_3

    const-string/jumbo v1, "http"

    invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_0

    const-string/jumbo v1, "https"

    invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_2

    :cond_0
    invoke-super {p0, p1}, Landroid/text/style/URLSpan;->onClick(Landroid/view/View;)V

    :cond_1
    :goto_0
    return-void

    :cond_2
    const-string/jumbo v1, "tel:"

    invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1

    const-string/jumbo v1, "tel:"

    const-string/jumbo v2, ""

    invoke-virtual {v0, v1, v2}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->c:Ljava/lang/String;

    invoke-direct {p0}, Lcom/waiqin365/lightapp/im/utils/URLSpanUtil;->a()V

    goto :goto_0

    :cond_3
    invoke-super {p0, p1}, Landroid/text/style/URLSpan;->onClick(Landroid/view/View;)V

    goto :goto_0
.end method

.method public updateDrawState(Landroid/text/TextPaint;)V
    .locals 1

    const-string/jumbo v0, "#007AFF"

    invoke-static {v0}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v0

    invoke-virtual {p1, v0}, Landroid/text/TextPaint;->setColor(I)V

    const/4 v0, 0x0

    invoke-virtual {p1, v0}, Landroid/text/TextPaint;->setUnderlineText(Z)V

    return-void
.end method
